<div class='head'>$lang.get('role.index.title')</div>

#parse('/widget/widget.message.html')

<div class='tabs'>
	<a href='/admin/role' class='selected'>$lang.get('a.role')</a>
</div>

#set($edit = $me.hasAccess('access.role.admin'))

<table id='role-table' class='tablesorter nospace' border="0" cellpadding="0" cellspacing="1">
	<thead>
		<tr>
			<th>$lang.get('role.name')</th>
			<th>$lang.get('role.memo')</th>
#if($edit)
			<th></th>
#end			
		</tr>
	</thead>
	<tbody>
#foreach($f in $list)
	<tr>
		<td>$f.name</td>
		<td>#if($f.memo)$f.memo#end</td>
	#if($edit)
		<td>
			<a class='btn btn-success btn-xs' href="/admin/role/edit?id=$f.id">$lang.get('a.edit')</a>
			<a class='btn btn-danger btn-xs' href="javascript:;" onclick="_delete('$f.id', this)">$lang.get('a.delete')</a>
		</td>
	#end
	</tr>
#end
	</tbody>
</table>

 #parse('/widget/goto.page.html')

<div class='btns'>
#if($edit)
	<a class='btn btn-success' href='/admin/role/create'>$lang.get('a.create')</a>
#end
</div>

#if($edit)
<script>
$('#role-table').tablesorter({headers:{2:{sorter:false}}});
function _delete(id, o) {
	if(confirm("$lang.get('title.are_u_sure_delete')")) {
		$.post('/admin/role/delete', {id: id}, function(d){
			$(o).parent().parent().remove();
		})
	}
}
</script>
#end